<?php
/**
 * Created by PhpStorm.
 * User: win10
 * Date: 2016-01-08
 * Time: 8:34
 */
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>address</title>
    <link rel="stylesheet" href="Public/Home/cs/address.css">
    <script type="text/javascript" src="Public/Home/js/area.js"></script>
    <script src="Public/jquery-1.8.2.min.js"></script>
    <!--<link rel="stylesheet" href="Public/Home/css/font-awesome.min.css">-->
    <!--<script type="text/javascript" src="Public/Home/js/jquery.min.js"></script>-->
    <!--<script type="text/javascript" src="Public/Home/js/js.js"></script>-->
</head>
<body>
<!--loading页面显示；-->
<!--<div class="loader">
    <img src="loader.gif" alt="">
</div>-->
<!-- logo开始 -->
<!--//城市联动-->
<script type="text/javascript">
		$(function(){
			//初始化方法
			area.init('area');
			//修改的时候默认被选中效果
			area.selected('黑龙江','哈尔滨','道里区');
		})
	</script>
<div class="container">
    <div id="logo">
        <a class="logo_p" href=""></a>
        <div class="help">
            <?php if(isset($_SESSION['uemail'])){?>
                
					<span><?php echo $_SESSION['uemail']?></span>
					<a href="<?php echo U('Index/out')?>">退出登录</a>
					|
					<a href="<?php echo U('Login/index')?>">更换用户</a>
					<?php }else{?>
					<span>欢迎光临凡客诚品</span>
					<a href="<?php echo U('Login/index')?>">登录</a>
					<a href="<?php echo U('Registered/index')?>">注册</a>
					
               <?php }?>
            <a class="help_center" href="">帮助中心</a>
        </div>
    </div>
</div>
<!-- logo结束 -->

<!-- 购物流程开始 -->
<div class="container">
    <div id="location">
        <span>1.我的购物车</span>
        <em>2.填写核对信息</em>
        <span>3.成功提交订单</span>
    </div>
</div>
<!-- 购物流程结束 -->
<script type="text/javascript">
	$(function(){
		//默认第一个选中
		$('.avtive').first().addClass('yangshi');
		//点击编辑添加显示窗口
		$('.dianji').click(function(){
			$('.xinagshi').css({display:'block'});
		})
		//点击x关闭显示窗口
		$('.close').click(function(){
			$('.xinagshi').css({display:'none'});
		})
		//点击选中
		$('.avtive').click(function(){

			//增加样式红框
			$(this).addClass('yangshi').siblings().removeClass('yangshi');
			//获取地址表 里的adid
			var adid=$(this).attr('adid');
			//赋值给隐藏域
			$('[name=adid]').val(adid);
			
		})
	})
</script>

<!-- main -->
<div class="container">
    <div id="main">
        <div class="address clearfix">
            <div class="left">
                <span>收货地址：</span>
            </div>
            <div class="right">
            	<?php foreach ($addressData as $v){?>
                <div class="address_info avtive" adid=<?php echo $v['adid']?>>
                    <h4 class="shouhuren"><?php echo $v['aconsignee']?></h4>
                    <div class="contact_info">
                        <p><?php echo $v['phpone']?></p>
                        <p><?php echo $v['addetail']?></p>
                        <p><?php echo $v['area']?>  <span>(<?php echo $v['postalcode']?>)</span></p>
                    </div>
                    <div class="edit_adrs dianji">
                        编辑
                    </div>
                </div>
                <?php }?>
                
                <div class="tianjia dianji" >
                    <a href="javascript:;">+添加新地址   </a>                                                          
                </div>
                <div class="xinagshi" style="width: 100%;height: 100%;position:fixed;left: 0;top: 0;background:rgba(0,0,0,0.3);display: none;">
	                <div class="addr-form" style="z-index: 10000;margin-top:80px;background: #ffffff;">
	                	<form action="<?php echo U('Address/add',array('sids'=>Q('get.sids')))?>" method="post">
	                		<ol>
	                			<li>
	                				<div>
	                					<span>*</span>
	                					收货人:
	                				</div>
	                				<div>
	                					<input type="text" name="aconsignee" id="" value="" placeholder="请填写真实姓名"/>
	                				</div>
	                			</li>
	                			<li>
	                				<div>
	                					<span>*</span>
	                					地&nbsp;区:
	                				</div>
	                				<div>
	                					<select name="area[]" id="area1">
			
										</select>
										<select name="area[]" id="area2">
											
										</select>
										<select name="area[]" id="area3">
											
										</select>
	                				</div>
	                			</li>
	                			<li>
	                				<div>
	                					<span>*</span>
	                					详细地址:
	                				</div>
	                				<div>
	                					<div>北京,</div>
	                					<div>北京市,</div>
	                					<div>崇文区</div>
	                					<input type="text" name="addetail" id="" value="" />
	                				</div>
	                			</li>
	                			<li>
	                				<div>
	                					<span>*</span>
	                					邮政编码:
	                				</div>
	                				<div>
	                					<input type="text" name="postalcode" id="" value="" />
	                					<span>参考邮编：100061</span>
	                					<a href="">使用此邮编</a>
	                				</div>
	                			</li>
	                			<li>
	                				<div>手机:</div>
	                				<div>
	                					<input type="text" name="phpone" id="" value="" />
	                				</div>
	                				<div>座机：</div>
	                				<div>
	                					<input type="text" name="telephpone" id="" value="" />
	                					<span>参考区号：010</span>
	                					<a href="">使用此区号</a>
	                				</div>
	                			</li>
	                			<li>
	                				<input type="submit" name="" id="" value="" class="save-new-addr track"/><label for=""></label>
	                			</li>
	                		</ol>
	                	</form>
	                	<a href="javascript:;" style="display: inline" class="close">X</a>
	                </div>
	            </div>
            </div>
        </div>
        <div class="send clearfix">
            <div class="left">
                <span>配送方式：</span>
            </div>
            <div class="right">
                <div class="sendway">
                    <input type="checkbox" id="kuaidi" checked="checked"  />
                    <label for="kuaidi">快递</label>
                    <input type="checkbox" id="ems" checked="checked" />
                    <label for="ems">邮政快递-EMS</label>
                    <span>乡村镇用户<a href="">查看货到付款配送范围</a></span>
                </div>
                <div class="sendtime clearfix">
                    <div class="workday active">
                        周一至周五丶工作日送货
                    </div>
                    <div class="weekday">
                        周六丶周日丶假日送货
                    </div>
                    <div class="anytime ">
                        周一至周日丶假日均可送货
                    </div>
                </div>
                <div class="shengming">
                    <span>声明：</span>
                    <p>1.送货时间：早8：30至晚7：30</p>
                    <p>2.我们会努力按照您选择的时间进行配送，但因天气丶交通等因素影响，您的订单有可能会有延迟现象，请您谅解！</p>
                </div>
            </div>
        </div>
        <div class="pay clearfix">
            <div class="left">
                <span>支付方式：</span>
            </div>
            <div class="right">
                <div  class="online_pay">
                    <a href="">在线支付</a>
                    <span class="show_bank_list">查看银行列表</span>
                    <div class="bank_list" style="display:none">
                        <img src="Punlic/Home/images/btn-use-giftcard.gif" alt="">
                    </div>
                </div>
                <div class="arrive_pay">
                    <a href="">货到付款</a>
                    <span>现金</span>
                </div>
                <div class="jifen">
                    <input type="checkbox" name="jifen" id="jifen" />
                    <label for="jifen">使用积分：</label>
                    使用0积分，抵现<span class="fcred">0元</span>
                </div>
                <div class="card"><!--使用礼品卡-->
                    <input type="checkbox" id="card" name="card" />
                    <label for="card">使用礼品卡：</label>
                    <div class="card_num">
                        <input type="text"  placeholder="请输入您礼品卡的号码" name="card_num1" id="card_num1" />
                        <input type="text" name="card_num2" placeholder="请输入您礼品卡的号码" id="card_num2" />
                    </div>
                    <button type="submit" name="submit">使用礼品卡</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- mainend -->
<!--  -->
<div class="container">
	<form action="<?php echo U('Order/addorder')?>" method="post">
    <div class="bill clearfix">
        <h4>开发票</h4>
        <div class="nd_bill">
            您需要开具发票吗？
            <input type="checkbox" value="nd" id="nd" name="nd" />
            <label for="nd">是</label>
            <input type="checkbox" value="nnd" id="nnd" name="nnd" />
            <label for="nnd">否</label>
        </div>
        <div class="bill_info">
            <label for="bill_type">* 客户类型</label>
            <input type="text" name="bill_type" value="个人" id="bill_type" />
            <label for="bill_head">* 发票开头</label>
            <input type="text" name="bill_head" placeholder="发票开头" id="bill_head" />
            <label for="bill_content">* 发票内容</label>
            <input type="text" name="bill_contend" placeholder="服装" id="bill_contend" />
        </div>

    </div>
    <div class="pro_lis">
        <div class="head">
                <h3>商品清单<a href="<?php echo U('Shoppingcar/index')?>">返回购物车，修改产品 >></a></h3>
            <p>
                <span class="head_left">订单num</span>
                将从<span class="fcred"><?php echo "这里是物流信息，，eg:北京二库"?></span>发出，预计发货后<span class="fcred">3天</span>内送达
            </p>
        </div>
        <div class="bottom">
            <table>
                <thead>
                <tr>
                    <th>商品名称</th>
                    <th>尺码</th>
                    <th>单价</th>
                    <th>数量</th>
                    <th>优惠</th>
                    <th>小计</th>
                </tr>
                </thead>
                <tbody>
                <?php foreach ($newData as $v){?>
                <tr>
                    <th><?php echo $v['name']?></th>
                    <th><?php echo $v['options'][0]?></th>
                    <th>￥<?php echo $v['price']?></th>
                    <th><?php echo $v['num']?></th>
                    <th>-</th>
                    <th class="xiaoji"><?php echo $v['total']?></th>
                </tr>
                <?php }?>
                </tbody>
            </table>
            <script type="text/javascript">
				$(function(){
					var m=0;
					//循环抓小计价格
					$.each($('.xiaoji'),function(){
						m+=parseFloat($(this).text());
					})
					//分配到页面
					$('.counting').text(m);
				})
			</script>
            <div class="pro_pay_all">
                <p>
                <span >
                    商品金额小计：<span>￥</span><span class="counting">0.00</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;应付：<span>￥</span><span class="counting">0.00</span>
                </span>
                </p>
                <b class="fcred">
                    已支付： <span>￥0.00</span>，您还需支付： <span>￥</span><span class="counting">3872.00</span>
                </b>

                <div class="submit">
                	<input type="hidden" name="adid" id="" value="" />
					<input type="hidden" name="sids" id="" value="<?php echo Q('get.sids')?>" />
                    <input type="submit"></input>
                </div>
            </div>
        </div>

    </div>
	</form>
</div>
<!-- footer开始 -->

<!-- 版权信息 -->
<p><span class="copyRight">Copyright 2007 - 2016 vancl.com All Rights Reserved 京ICP证100557号 京公网安备11011502002400号 出版物经营许可证新出发京批字第直110138号
</span></p>
<div class="friendLink">
    <a class="cloth" href="" style="padding-left: 90px;"><img src="Public/Home/images/cert-redlogo.gif.png" alt=""></a>
    <a class="webjiaoyi" href="" style="padding-left: 20px;"><img src="Public/Home/images/cert-costumeorg.gif" alt=""></a>
    <a class="runing" href="" style="padding-left: 80px;"><img src="Public/Home/images/cert-wsjybzzx.gif.png" alt=""></a>
</div>
<!-- footer结束 -->
</body>
</html>